package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.CourseActivityMapper;
import com.ruoyi.system.domain.CourseActivity;
import com.ruoyi.system.service.ICourseActivityService;

/**
 * 活动课程Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-20
 */
@Service
public class CourseActivityServiceImpl implements ICourseActivityService 
{
    @Autowired
    private CourseActivityMapper courseActivityMapper;

    /**
     * 查询活动课程
     * 
     * @param id 活动课程主键
     * @return 活动课程
     */
    @Override
    public CourseActivity selectCourseActivityById(Long id)
    {
        return courseActivityMapper.selectCourseActivityById(id);
    }

    /**
     * 查询活动课程列表
     * 
     * @param courseActivity 活动课程
     * @return 活动课程
     */
    @Override
    public List<CourseActivity> selectCourseActivityList(CourseActivity courseActivity)
    {
        return courseActivityMapper.selectCourseActivityList(courseActivity);
    }

    /**
     * 新增活动课程
     * 
     * @param courseActivity 活动课程
     * @return 结果
     */
    @Override
    public int insertCourseActivity(CourseActivity courseActivity)
    {
        courseActivity.setCreateTime(DateUtils.getNowDate());
        return courseActivityMapper.insertCourseActivity(courseActivity);
    }

    /**
     * 修改活动课程
     * 
     * @param courseActivity 活动课程
     * @return 结果
     */
    @Override
    public int updateCourseActivity(CourseActivity courseActivity)
    {
        courseActivity.setUpdateTime(DateUtils.getNowDate());
        return courseActivityMapper.updateCourseActivity(courseActivity);
    }

    /**
     * 批量删除活动课程
     * 
     * @param ids 需要删除的活动课程主键
     * @return 结果
     */
    @Override
    public int deleteCourseActivityByIds(Long[] ids)
    {
        return courseActivityMapper.deleteCourseActivityByIds(ids);
    }

    /**
     * 删除活动课程信息
     * 
     * @param id 活动课程主键
     * @return 结果
     */
    @Override
    public int deleteCourseActivityById(Long id)
    {
        return courseActivityMapper.deleteCourseActivityById(id);
    }
}
